package com.liucxu.zimuzu.Base;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

/**
 * Activity基础类库
 * Created by liukanshan on 2016/12/8.
 */

public abstract class BaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
        setupView();
        setupData();
    }

    public abstract int getLayoutId();

    public abstract void setupView();

    public abstract void setupData();

    public <T extends View> T $(int id) {
        return (T) super.findViewById(id);
    }
}
